﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class YFKLR_YFKLRList : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
    BindGrid();
  }

  protected void BindGrid()
  {
    string sSql = @"select a.*,convert(varchar,yfklrrq,23) YFKLRRQ,b.*,c.*
from sjlr_yfklr a,sys_user b,jcxx_khxx c where a.dlm=b.dlm and a.khid=c.khid ";
    DataSet ds = DbHelperSQL.Query(sSql);
    ASPxGridView1.DataSource = ds;
    ASPxGridView1.DataBind();
  }

  protected void lbDelete_Command(object sender, CommandEventArgs e)
  {
    SqlParameter[] cmdParams = null;
    string sSql = "";
    List<CommandInfo> cis = new List<CommandInfo>();
    CommandInfo ci;

    sSql = "delete from SJLR_yfklr where yfkid=" + e.CommandArgument.ToString();
    ci = new CommandInfo();
    ci.CommandText = sSql;
    ci.Parameters = cmdParams;
    cis.Add(ci);

    if (DbHelperSQL.ExecuteSqlTran(cis) > 0)
    {
      BindGrid();
    }
  }
}
